//
//  TRMyUploadViewController.m
//  WeiMiLan
//
//  Created by anan on 14/12/19.
//  Copyright (c) 2014年 Mac. All rights reserved.
//

#import "TRMyUploadViewController.h"

@interface TRMyUploadViewController ()

@end

@implementation TRMyUploadViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view from its nib.
    self.automaticallyAdjustsScrollViewInsets = NO;
    [self initNavigation];
}

- (void)viewDidAppear:(BOOL)animated
{
    [super viewDidAppear:animated];
    if (self.viewPager==nil) {
        [self initViewPager];
    }
}

- (void)initViewPager
{
    CGRect rect = CGRectMake(0, 0, self.viewContent.frame.size.width, self.viewContent.frame.size.height);
    self.viewPager = [[QLViewPager alloc]initWithFrame:rect];
    self.viewPager.pageIndicatorHeight = 30;
    self.viewPager.backgroundColor = [UIColor colorWithWhite:0.092 alpha:1.000];
    self.viewPager.scrollView.backgroundColor = [UIColor clearColor];
    self.viewPager.showPageIndicator = YES;
    [self.viewPager setup];
    [self.viewContent addSubview:self.viewPager];
    self.adapter = [[TRMyUploadFragmentAdapter alloc] initWithViewController:self];
    [self.viewPager setAdapter:self.adapter];
    
    self.viewPager.delegate = self;
    [self onPageChange:self.viewPager select:self.viewPager.currentIndex];
}

- (void)initNavigation
{
    [self.navigationController setNavigationBarHidden:YES animated:YES];
    self.weChatNavigationBar=[[WeChatNavigationBar alloc] init];
    [self.view addSubview:self.weChatNavigationBar];
    self.weChatNavigationBar.titleLabel.text=@"我的上传";
    [self.weChatNavigationBar.leftButton addTarget:self action:@selector(exit) forControlEvents:UIControlEventTouchUpInside];
    
    self.weChatNavigationBar.rightButton.hidden = YES;
}

-(void)exit
{
    [self.navigationController popViewControllerAnimated:YES];
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that ca n be recreated.
}

-(void)removeTopButton{
    
}

-(void)visibleTop{
    
}

#pragma mark --QLViewPagerDelegate
- (void)onPageChange:(QLViewPager *)viewPager select:(int)select
{
    
}

@end
